<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVipProductsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('vip_products', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->decimal('original_price',8,2)->default(0)->comment('原价');
            $table->decimal('sell_price',8,2)->default(0)->comment('卖价');
            $table->integer('year')->unique()->default(0)->comment('年份 0 是永久');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('vip_products');
    }
}
